Skip to content

WIP: generalize post test debug#1072

Closed
DavidRajnoha wants to merge 2 commits into
mainfrom
test/POC-generalize-post-test-debug
Closed

WIP: generalize post test debug#1072
DavidRajnoha wants to merge 2 commits into
mainfrom
test/POC-generalize-post-test-debug

Conversation

@DavidRajnoha

@DavidRajnoha DavidRajnoha commented Apr 24, 2026

Copy link
Copy Markdown
Collaborator

Follow Up of #1038

@openshift-ci

openshift-ci Bot commented Apr 24, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: DavidRajnoha
Once this PR has been reviewed and has the lgtm label, please assign jan--f for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai

coderabbitai Bot commented Apr 24, 2026

Copy link
Copy Markdown

Important

Review skipped

Ignore keyword(s) in the title.

⛔ Ignored keywords (1)
  • WIP

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 41a33fe8-674e-472e-b909-cef109573782

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/POC-generalize-post-test-debug

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci

openshift-ci Bot commented Apr 24, 2026

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@DavidRajnoha DavidRajnoha changed the title test: generalize post test debug WIP: generalize post test debug Apr 24, 2026
Cache the full ClusterVersion object during Framework.Setup() so that
SkipIfClusterVersionBelow uses the cached value instead of making a
redundant API call. Also add a comment explaining the unique suffix
for rule names.

Made-with: Cursor
Introduce a composable DebugFunc interface and DumpOnFailure helper in
the e2e framework. Tests register debug functions (namespace dumps,
CR-specific diagnostics) that only run when the test fails. Apply it
across all e2e test suites for consistent post-failure diagnostics.

Includes temporary ForceFailure calls (marked TODO: remove) to exercise
the debug dump output.

Made-with: Cursor
@DavidRajnoha DavidRajnoha force-pushed the test/POC-generalize-post-test-debug branch from 5aec1d8 to 7a4d05b Compare June 3, 2026 11:52
@DavidRajnoha

Copy link
Copy Markdown
Collaborator Author

Example of debug log, full output attached:

=== RUN   TestMonitoringStackController
    monitoring_stack_controller_test.go:52: forced failure to test debug dump output
    framework.go: --- Dumping debug info for namespace e2e-tests ---
    framework.go: === BEGIN DEBUG DUMP ===
    framework.go: Deployments in namespace e2e-tests: 0
    framework.go: Pods in namespace e2e-tests: 0
    framework.go: Events in namespace e2e-tests: 0
    framework.go: === END DEBUG DUMP ===
--- FAIL: TestMonitoringStackController (0.52s)

=== RUN   TestObservabilityInstallerController/ObservabilityInstallerTracing
    observability_installer_test.go:49: forced failure to test debug dump output
    framework.go: --- Dumping debug info for namespace openshift-cluster-observability-operator ---
    framework.go: === BEGIN DEBUG DUMP ===
    framework.go: Deployments in namespace openshift-cluster-observability-operator: 6
    framework.go:   Deployment: name=health-analyzer replicas=1 readyReplicas=1 availableReplicas=1
    framework.go:     condition: type=Available status=True reason=MinimumReplicasAvailable ...
    framework.go:   Deployment: name=obo-prometheus-operator replicas=1 readyReplicas=1 availableReplicas=1
    framework.go:     condition: type=Available status=True reason=MinimumReplicasAvailable ...
    framework.go:   ... (6 deployments total)
    framework.go: Pods in namespace openshift-cluster-observability-operator: 7
    framework.go:   Pod: name=health-analyzer-85bf6b7b69-ctcrp phase=Running
    framework.go:     container=health-analyzer ready=true restarts=0 state=Running
    framework.go:   Pod: name=observability-operator-fc695d7-jbxj5 phase=Running
    framework.go:     container=operator ready=true restarts=0 state=Running
    framework.go:   ... (7 pods total)
    framework.go: Events in namespace openshift-cluster-observability-operator: 137
    framework.go:   Event: involvedObject=Pod/obo-prometheus-operator-... reason=Failed message=Error: ImagePullBackOff type=Warning count=5
    framework.go:   Event: involvedObject=ClusterServiceVersion/cluster-observability-operator.v1.5.0 reason=InstallWaiting message=installing: waiting for deployment obo-prometheus-operator to become ready ...
    framework.go:   ... (137 events total)
    framework.go: === END DEBUG DUMP ===
    framework.go: --- Dumping debug info for namespace tracing-observability ---
    framework.go: === BEGIN DEBUG DUMP ===
    framework.go: Deployments in namespace tracing-observability: 0
    framework.go: Pods in namespace tracing-observability: 0
    framework.go: Events in namespace tracing-observability: 0
    framework.go: === END DEBUG DUMP ===
--- FAIL: TestObservabilityInstallerController/ObservabilityInstallerTracing (1.05s)

=== RUN   TestUIPlugin/Cluster_health_analyzer
    uiplugin_cluster_health_analyzer_test.go:42: forced failure to test debug dump output
    framework.go: --- Dumping debug info for namespace openshift-cluster-observability-operator ---
    framework.go: === BEGIN DEBUG DUMP ===
    framework.go: Deployments in namespace openshift-cluster-observability-operator: 6
    framework.go:   ...
    framework.go: === END DEBUG DUMP ===
    uiplugin_cluster_health_analyzer_test.go: UIPlugin "monitoring" generation=1, resourceVersion=...
    uiplugin_cluster_health_analyzer_test.go: UIPlugin spec.type=Monitoring
    uiplugin_cluster_health_analyzer_test.go: UIPlugin spec.monitoring.clusterHealthAnalyzer.enabled=true
    uiplugin_cluster_health_analyzer_test.go: UIPlugin condition: type=Available status=True reason=Available message=...
    uiplugin_cluster_health_analyzer_test.go: Total UIPlugins in cluster: 1
--- FAIL: TestUIPlugin/Cluster_health_analyzer (1.96s)

# DumpOnFailure does NOT fire on passing tests:
=== RUN   TestUIPluginUninstallCleanup
--- PASS: TestUIPluginUninstallCleanup (60.33s)
    --- PASS: TestUIPluginUninstallCleanup/cascade_deletion/monitoring_plugin_deployment_is_deleted (0.18s)
    --- PASS: TestUIPluginUninstallCleanup/cascade_deletion/health-analyzer_deployment_is_deleted (0.20s)
    --- PASS: TestUIPluginUninstallCleanup/cascade_deletion/no_UIPlugin-managed_pods_remain_in_operator_namespace (10.55s)
    ...

dump-demo.log

@DavidRajnoha

Copy link
Copy Markdown
Collaborator Author

Superseded by a cleaner PR without temporary test scaffolding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant